package com.example.base.util;

import com.example.base.app.AppInfo;

public class AppUtils {

    public static Boolean isAppInfo(Class<?> clazz){
        return isHasInterface(clazz, AppInfo.class);
    }

    private static Boolean isHasInterface(Class<?> clazz,Class<?> interfaceClass){
        if(clazz==null){
            return false;
        }
        if(clazz.isInterface()){
            return false;
        }
        if(!interfaceClass.isInterface()){
            return false;
        }
        Class<?>[] interfaces = clazz.getInterfaces();
        for (Class<?> cls : interfaces) {
            if (cls.equals(interfaceClass)) {
                return true;
            }
        }
        return false;
    }
}
